package com.wk1un2.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
	private Integer code;// 0,1
	private String msg;
	private Integer count;
	private Object data;
	/**
	 * @param data the data to set
	 */
	public void setData(Object data) {
		this.data = data;
	}

	public static Result ok(Object list) {
		Result result = new Result();
		result.setCode(1);
		result.setData(list);
		return result;
	}

	public static Result ok(String msg) {
		Result result = new Result();
		result.setCode(1);
		result.setMsg(msg);
		return result;
	}
}
